package linwen.wang.user.controller;

import linwen.wang.user.entity.User;
import linwen.wang.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
@Slf4j
public class UserController {
    @Autowired
    private UserService userService;


    @GetMapping("/{userId}")
    public User getUserById(@PathVariable("userId") Long userId){
        return userService.getById(userId);
    }
}
